<me:UIGAAUF x:Class="WPFExcelReport.TGD733"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
     xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
     xmlns:me="clr-namespace:WPFExcelReport" 
     xmlns:PR="clr-namespace:WPFExcelReport;assembly=TICC_PRULES"  
     xmlns:MU="clr-namespace:WPFExcelReport;assembly=TABAUFM" 
     xmlns:ABK="clr-namespace:WPFExcelReport;assembly=TABKOPF"  
    xmlns:GS="clr-namespace:WPFExcelReport;assembly=TGSDAT"  
    xmlns:GSC="clr-namespace:WPFExcelReport;assembly=TGSCOLOR"  
    xmlns:QR="clr-namespace:WPFExcelReport;assembly=TICC_AV95RULES" 
    xmlns:GC="clr-namespace:WPFExcelReport;assembly=TGSCOLOR" 
     xmlns:G8="clr-namespace:WPFExcelReport;assembly=TGASTGA" 
    x:Name="TV"
    Loaded="Window_Loaded"
 >
    <me:UIGAAUF.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:TextTrimmingConverter  x:Key="trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:UPPERGB2312 x:Key="UGB"/> 
    </me:UIGAAUF.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="Auto" /> 
        </Grid.RowDefinitions> 
        <WrapPanel Grid.Row="0" >
            <Button Grid.Column="0" FontSize="18" Width="30" Height="30" Margin="10,0,0,0"  Click="NewCommand">
                <Button.Background>
                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                </Button.Background>
            </Button>
            <Button  Click="EditCommand" Width="30" Height="30">
                <Button.Background>
                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                </Button.Background>
            </Button>
            <Button   Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="24" 
                      Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}" >
                <Button.Background>
                    <ImageBrush  ImageSource="/ImagePackage;component/Images/save.png" />
                </Button.Background>
            </Button>
            <Grid  Margin="0,0,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" 
                            Text="{Binding Source={Localization:Translate Word=ID}}"  VerticalAlignment="Center" />
                <TextBlock Grid.Column="1" Background="White"   Height="Auto"    Width="20" 
                           Text="{Binding Path=GAPOS}"  Margin="15,0,0,0"   VerticalAlignment="Center"/>
            </Grid>
            <Grid  Margin="0,0,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=MU}}"  VerticalAlignment="Center" />
                <ex:TXT72 MaxLength="2" CharacterCasing="Upper" Grid.Column="1" Background="White"   Height="Auto" Width="40" 
                         Text="{Binding Path=GAAUFMSL}"  Margin="15,0,0,0"   VerticalAlignment="Center"/>
            </Grid>
            <Grid Margin="10,0,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=纱线:}}"></TextBlock>
                <GS:TSGS02  Grid.Column="1" Name="cGS02" 
                            Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}"
                            ORDERNUM="{Binding GSART,ElementName=TV}"
                             />
                <ex:TXT72   Grid.Column="2" CharacterCasing="Upper" 
                            MaxLength="20"
                            Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}"
                            Text="{Binding Path=GAART, Source={StaticResource ResourceKey=vwMaster}}" 
                             IsReadOnly="{Binding IsEdit,Converter={StaticResource nbv}}"
                            Width="100" />
            </Grid>
            <Grid  Margin="0,0,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=版本}}"  VerticalAlignment="Center" />
                <TextBox   Grid.Column="1" Background="White" CharacterCasing="Upper"  Height="Auto"    Width="40" 
                         Text="{Binding Path=GAVAR, Source={StaticResource ResourceKey=vwMaster}}" 
                            IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}"
                           Margin="0,0,0,0"   VerticalAlignment="Center"/>
            </Grid>
            <Grid Margin="10,0,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>

                </Grid.ColumnDefinitions>
                <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=色号:}}"></TextBlock>
                <GSC:TSGS06  Grid.Column="1" GSART="{Binding KEY,ElementName=cGS02}" 
                              Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}"
                             ORDERNUM="{Binding GAFARBE,ElementName=TV}"/>
                <ex:TXT72 MaxLength="10" Grid.Column="2" CharacterCasing="Upper" 
                           Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}"
                          IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}"
                          Text="{Binding Path=GAFARBE,Converter={StaticResource ResourceKey=gb2312}, Source={StaticResource ResourceKey=vwMaster}}"
                          Width="100" />
            </Grid> 
        </WrapPanel>
        <WrapPanel Grid.Row="1" > 
            <Grid  Margin="0,0,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=比例}}"  VerticalAlignment="Center" />
                <ex:NumericBox  Grid.Column="1" Background="White"   Height="Auto"    Width="80"
                         Text="{Binding Path=GASP1,Converter={StaticResource ResourceKey=d1000},  Source={StaticResource ResourceKey=vwMaster}}"  Margin="15,0,0,0"   VerticalAlignment="Center"/>
            </Grid>
            <Grid  Margin="0,0,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=数量}}"  VerticalAlignment="Center" />
                <ex:NumericBox  Grid.Column="1" Background="White"   Height="Auto"    Width="80"
                         Text="{Binding Path=GAKG1,Converter={StaticResource ResourceKey=d100}}"  Margin="15,0,0,0"   VerticalAlignment="Center"/>
            </Grid>
            
            <Grid  Margin="0,0,0,0" Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Button FontSize="18" Width="30" Height="30" Margin="20,0,0,0"     Click="DeleteCommand">
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/delete.png" />
                    </Button.Background>
                </Button>
                <TextBlock Grid.Column="1"  Background="White"   Height="Auto"    Width="Auto"   Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=删除}}"   VerticalAlignment="Center"/>
                <TextBox Grid.Column="2"  Background="White"   Height="Auto"    Width="Auto" Name="txtGADel"  Margin="0,0,0,0" Text="N"   VerticalAlignment="Center"/>
            </Grid> 
        </WrapPanel> 
        <DataGrid Grid.Row="2"  
                AutoGenerateColumns="False"  
                  EnableRowVirtualization="False"  
                  Name="dlgMaster"  
                 ItemsSource="{Binding Source={StaticResource vwMaster }}" 
                  HeadersVisibility="Column" 
                  CanUserReorderColumns="True"
                  CanUserResizeRows="True"  
                  RowDetailsVisibilityMode="VisibleWhenSelected" 
                  Width="Auto" Height="Auto"
                  EnableColumnVirtualization="True" 
                  HorizontalScrollBarVisibility="Auto"
                  VerticalScrollBarVisibility="Auto">
            <DataGrid.Columns>
                <DataGridTextColumn Header="" Binding="{Binding GAAUFKRS}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=生产单}}" Binding="{Binding GAAUFLFD}" Width="Auto"/>
                <DataGridTextColumn Header="" Binding="{Binding GAAUFPOS}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=ID}}" Binding="{Binding GAPOS}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=类型}}" Binding="{Binding GAAUFMSL,Converter={StaticResource ResourceKey=UGB}}" Width="Auto"   />
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=纱线}}" Binding="{Binding GAART, Converter={StaticResource ResourceKey=UGB}}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=版本}}" Binding="{Binding GAVAR,Converter={StaticResource ResourceKey=UGB}}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=色号}}" Binding="{Binding GAFARBE, Converter={StaticResource ResourceKey=UGB}}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=批次}}" Binding="{Binding Path=GABEM, Converter={StaticResource ResourceKey=UGB}}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=比例}}" Binding="{Binding Path=GASP1, Converter={StaticResource ResourceKey=d1000}}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=需求}}" Binding="{Binding Path=GAKG1, Converter={StaticResource ResourceKey=d100}}" IsReadOnly="True" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=预留}}" Binding="{Binding Path=GAKG2, Converter={StaticResource ResourceKey=d100}}" IsReadOnly="True" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=总仓}}" Binding="{Binding Path=GAKG3, Converter={StaticResource ResourceKey=d100}}" IsReadOnly="True" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=车间}}" Binding="{Binding Path=GAKG5, Converter={StaticResource ResourceKey=d100}}" IsReadOnly="True" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=差异}}" Binding="{Binding Path=GAKG0, Converter={StaticResource ResourceKey=d100}}" IsReadOnly="True" Width="40"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=开始}}" Binding="{Binding GADATBIS}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=版本}}" Binding="{Binding GAURVAR}" Width="Auto"/>
            </DataGrid.Columns>

        </DataGrid>
        <WrapPanel Grid.Row="3" >
            <TextBlock Height="Auto"   Width="Auto"  Margin="20,0,0,0" Text="{Binding Source={Localization:Translate Word=需求}}"  VerticalAlignment="Center" />
            <TextBlock Background="White"  Text="{Binding Path=GAKG1,Converter={StaticResource ResourceKey=d100}}"  Height="Auto"    Width="60"     Margin="5,0,0,0"   VerticalAlignment="Center"/>
            <TextBlock Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=留位}}"  VerticalAlignment="Center" />
            <TextBlock Background="White"  Text="{Binding Path=GAKG3,Converter={StaticResource ResourceKey=d100}}"  Height="Auto"    Width="60"     Margin="5,0,0,0"   VerticalAlignment="Center"/>
            <TextBlock Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=车间}}"  VerticalAlignment="Center" />
            <TextBlock Grid.Column="1" Background="White"  Text="{Binding Path=GAKG5,Converter={StaticResource ResourceKey=d100}}"  Height="Auto"    Width="60"     Margin="5,0,0,0"   VerticalAlignment="Center"/>
            <TextBlock Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=缺口}}"  VerticalAlignment="Center" />
            <TextBlock Grid.Column="1" Background="White" Text="{Binding Path=REQ,Converter={StaticResource ResourceKey=d100}}"  Height="Auto"    Width="60"     Margin="5,0,0,0"   VerticalAlignment="Center"/>
        </WrapPanel>
    </Grid> 
</me:UIGAAUF>
